吧<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>博客管理系统</title>
  <link rel="stylesheet" href="css/login.css">
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/index.js"></script>
  <script src="./lib/layui/layui.js" charset="utf-8"></script>
</head>
<body class="login-bg">
    <canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
    <div class="login">
        <div class="message">博客系统登录</div>
        <div id="darkbannerwrap"></div>   
        <form method="post" class="layui-form" id="f_login" onsubmit="return false;">
            <input name="name" id="name" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" id="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" class="layui-btn" style="width:100%;" onclick="login()">
            <hr class="hr20" >
        </form>
    </div>
    <script>
    		var $=null;
    		var from=null;
    		var layer=null;
            layui.use(['form'],function() {
               $ = layui.jquery;
			   form = layui.form;
			   layer = layui.layer;
				
				
            });
            function login(){
            	$.post("/login1",$("#f_login").serialize(),function(res){
					console.log(res)
						if(res.code==0){
							var u=JSON.stringify(res.data);
							console.log(u);
							window.localStorage.setItem("user",u);
							window.location.href="index.html";
							
						} else{
							alert("账号或密码错误");
						}
					},"json");
					
				}
     </script>

    
    <!-- 底部结束 -->
    
</body>
</html>